<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="div01">00.0000</div>
		<button id="btn1" onclick="test1()">开始</button>
		<button id="btn2" onclick="test2()">停止</button>
		<button id="btn2" onclick="test3()">清空</button>
		<script type="text/javascript">		
			var t;
			// * 练习4：
			// 编写一个秒表
			function test1()
			{
				t=setTimeout(time,1);
			}
			
			function test2()
			{
			}
			
			function time()
			{
				var time1;
				time1 += 1;
				var time2=0;
				div01.textContent=time2+"."+time1;
			}
		</script>
	</body>
</html>
